import cv2
import numpy as np


dog = cv2.imread('img/dog.jpg')

# 缩放算法
# INTER_NEAREST,邻近插值，速度快，效果差
# INTER_LINEAR,双线性插值，原图中的4个点
# INTER_CUBIC,三次插值，原图中的16个点
# INTER_AREA，效果最好

# new = cv2.resize(dog, (100, 100))
# new = cv2.resize(dog,None,fx=0.3,fy=0.3)
# new = cv2.resize(dog,None,fx=0.3,fy=0.3, interpolation=cv2.INTER_AREA)

#翻转 0 上下翻转，1 左右翻转，-1 上下左右翻转
new = cv2.flip(dog, -1)

cv2.imshow('dog', dog)
cv2.imshow('new', new)
cv2.waitKey(0)